class BaseError{
    message = ''
    constructor(message){
        this.message = message
    }
}

export class UnknownError extends BaseError{
    message = '未知错误'
}

export class GetLocalTrackFailedError extends BaseError{
    constructor(type){
        const type_cn = ({
            video:'摄像头',
            audio:'麦克风',
            desktop:'共享屏幕'
        })[type]
        super(`获取本地轨道失败:${type_cn}`)
    }
}

export class ConnectionFailedError extends BaseError{
    message = '连接失败'
}

export class TimeOutError extends BaseError{
    message = '请求超时'
}
